package JB1;
import java.util.Scanner;
public class PrimeNumbers {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		System.out.print("Please enter number ");
		int num = sc.nextInt();
		if (num >= 2) {
			System.out.print(2);
		} else {
			System.out.println("No numbers in this range");
		}
		for (int i = 2; i <= num; i++) {
			for (int j = 2; j <= i; j++) {

				if (i % j == 0) {
					break;
				} else {
					if (j == i - 1) {
						System.out.print(" " + i);
					}
				}
			}
		}
	}
}
